package com.sugar.domain.oa.hr;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @标题：员工账号表
 * @描述：员工登录账号实体
 * @编写者：杨浩泉
 * @日期：2011-5-27 <b>下午03:22:52</b>
 */
@Entity@Table(name="sugar_emp_account")
public class EmpAccount {
	
	private int id ;
	
	/** 员工登录账号 **/
	private String username ;
	
	/** 员工登录密码 **/
	private String password ;
	
	/** 员工账号状态(true:激活 / false:未激活) **/
	private boolean state ;
	
	/** 员工账号与员工信息一对一关联关系 **/
	private Employee emp ;

	@OneToOne(mappedBy="account",fetch=FetchType.LAZY)
	@JoinColumn(name="ea_id")
	public Employee getEmp() {
		return emp;
	}

	public void setEmp(Employee emp) {
		this.emp = emp;
	}

	@Id@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public boolean isState() {
		return state;
	}

	public void setState(boolean state) {
		this.state = state;
	}

}
